#pragma once

#include <cinttypes>

#include "Misc/CommonMacros.h"
//#include "Misc/StdHead.h"
#include "Containers/String.h"

class CNamePool;

//for quick compare
class WHENGINE_API CName
{
public:
    CName(const CString& NameInString);

    static  CName MakeUniqueName(const CString& InBaseName) ;

    static  CName MakeUniqueName(const CName& InBaseName) ;

    CString ToString() const;
    
    bool operator ==(const CName & Other)
    {
        return NamePool==Other.NamePool &&  Index==Other.Index;
    } 

    static CName InvalidName()
    {
        static CName None=CName(nullptr,0);
        return None;
    }
private:
    CName(CNamePool* InPool,uint32_t InIndex)
    :NamePool(InPool),Index(InIndex)
    {}

    uint32_t Index=0;
    CNamePool* NamePool=nullptr;

    friend CNamePool;
};






